var rMouseEvent = /^(?:mouse|contextmenu)|click/,
    rKeyboardEvent = /^(?:key(?:down|press|up))$/,
    rMousewheel = /^(?:DOMMouseScroll|mousewheel)$/;
function EventFactory(original) {
    var type=original.type;
    if(rMouseEvent.test(type)){
        return new MouseEvent(original);
    }else if(rKeyboardEvent.test(type)){
        return new KeyboardEvent(original);
    }else if(rMousewheel.test(type)){
        return new WheelEvent(original);
    }else{
        return new Event(original);
    }
}
function Event(original) {
    this.originalEvent=original;
}
Event.prototype={
    normal:function(){
        console.log('normal Event!');
    }
};


function MouseEvent(original) {
    Event.call(this,original);
    /*===extend start===*/
    var F = function () {};
    F.prototype = Event.prototype;
    this.prototype = new F;
    this.prototype.constructor=MouseEvent
    this.parent=Event.prototype
}
MouseEvent.prototype.getPageX=function(){
    console.log('MouseEvent pageX!');
};
function KeyboardEvent(original) {
    Event.call(this,original);
    KeyboardEvent.prototype=new Event;
}
KeyboardEvent.prototype.constructor=MouseEvent;
KeyboardEvent.prototype.getButton=function(){
    console.log('KeyboardEvent getButton method!');
};

function WheelEvent(original) {
    Event.call(this,original);
    WheelEvent.prototype=new Event;
}
WheelEvent.prototype.constructor=MouseEvent;
WheelEvent.prototype.getWheelData=function(){
    console.log('wheelEvent wheelData method!');
};